package com.bw.inspection.model

import com.bw.common.entity.BaseRes
import com.bw.inspection.api.InspectionApiServer
import com.bw.inspection.entity.InspectionEntity
import com.bw.inspection.entity.InspectionEntityItem
import com.bw.inspection.entity.NoInspenctionEntityItem
import javax.inject.Inject

class InspectionRepository @Inject constructor(private val apiServer: InspectionApiServer){
    suspend fun loadInspectionData(): BaseRes<List<InspectionEntityItem>> {
        return apiServer.getInspection()
    }
    //添加
    suspend fun loadAddInspectionData(inspectionEntity: InspectionEntityItem):BaseRes<InspectionEntityItem>{
        return apiServer.postAddInspection(inspectionEntity)
    }
    //详情
    suspend fun loadInspectionDetailData(id:Int):BaseRes<InspectionEntityItem>{
        return apiServer.getInspectionDetail(id)
    }
    //巡检代办
    suspend fun loadPatrolTaskData(status:String):BaseRes<List<NoInspenctionEntityItem>>{
        return apiServer.getPatrolTaskByStatus(status)
    }
    //巡检代办详情
    suspend fun loadPatrolTaskDetailData(id:Int):BaseRes<NoInspenctionEntityItem>{
        return apiServer.getPatrolTaskDetail(id)
    }
}